import { _decorator, Component, Label } from 'cc';
import { IPlayer } from '../Common/Api';
const { ccclass, property } = _decorator;

@ccclass("PlayerManager")
export class PlayerManager extends Component {

    init(data: IPlayer) {
        let label = this.node.getComponent(Label);
        if(data.rid) {
            label.string = data.nickname + `  房间号：${data.rid}`;
        } else {
            label.string = data.nickname
        }


        this.node.active = true;
    }
}